


use "$path\Intermediary Data\moments_alt.dta", clear
sum kurtosis , d
local min=2.5
local max=97.5
winsor2 kurtosis , replace  cuts(`min' `max') trim
replace kurto=. if kurto>9
sum kurtosis , d
merge 1:1 id using "$path\Intermediary Data\moments_EG"
sum freq , d
local min=2.5
local max=97.5
winsor2 freq , replace  cuts(`min' `max') trim
sum freq , d


egen tot=sum(nobs)
keep if _m==3
drop _m
merge 1:1 id using "$path\Intermediary Data\kurto_hetero"
sum k_10 , d
local min=2.5
local max=97.5
winsor2 k_10 , replace  cuts(`min' `max') trim
sum k_10 , d
winsor2 k_5 , replace  cuts(`min' `max') trim
sum k_5, d
winsor2 k_15 , replace  cuts(`min' `max') trim
sum k_15, d
winsor2 k_20 , replace  cuts(`min' `max') trim
sum k_20, d
winsor2 k_25 , replace  cuts(`min' `max') trim
sum k_25, d


keep if _m==3
drop _m

save "$path\Intermediary Data\base_stat_desc", replace
merge m:m id using  "$path\Intermediary Data\base_id_suff_stat_6Y"
keep if _m==3
drop _m

preserve
collapse (mean) freq mean meanp meann sd skewness kurto 
gen case="mean"
save "$path\Intermediary Data\stat1", replace
restore

preserve
collapse (p25) freq mean meanp meann sd skewness kurto  
gen case="p25"
save "$path\Intermediary Data\stat2", replace
restore

preserve
collapse (p50) freq mean meanp meann sd skewness kurto  
gen case="p50"
save "$path\Intermediary Data\stat3", replace
restore

preserve
collapse (p75) freq mean meanp meann sd skewness kurto  
gen case="p75"
save "$path\Intermediary Data\stat4", replace
restore

preserve
collapse (p10) freq mean meanp meann sd skewness kurto  
gen case="p10"
save "$path\Intermediary Data\stat5", replace
restore

preserve
collapse (p90) freq mean meanp meann sd skewness kurto  
gen case="p90"
save "$path\Intermediary Data\stat6", replace
restore

use "$path\Intermediary Data\stat1", clear
append using "$path\Intermediary Data\stat5"
append using "$path\Intermediary Data\stat2"
append using "$path\Intermediary Data\stat3"
append using "$path\Intermediary Data\stat4"

append using "$path\Intermediary Data\stat6"
save "$path\Intermediary Data\stat_moments", replace
erase "$path\Intermediary Data\stat1.dta"
erase "$path\Intermediary Data\stat2.dta"
erase "$path\Intermediary Data\stat3.dta"
erase "$path\Intermediary Data\stat4.dta"
erase "$path\Intermediary Data\stat5.dta"
erase "$path\Intermediary Data\stat6.dta"

use "$path\Intermediary Data\base_stat_desc", clear

hist freq , percent  start(0.1) color(blue)  width(0.02)  ///
	   fcolor(gs10) lcolor(black) ytitle( "%") xtitle("Freq. of price changes") graphregion(color(white)) 
graph export "$path\Graphs_Tables\Figure_1A.png", replace
graph export "$path\Graphs_Tables\Figure_1A.eps", replace

hist kurto , percent   color(blue)  width(0.25)  ///
	   fcolor(gs5) lcolor(black) ytitle( "%") xlabel(2(1) 9) xtitle("Kurtosis of price changes") graphregion(color(white)) 
graph export "$path\Graphs_Tables\Figure_1B.png", replace
graph export "$path\Graphs_Tables\Figure_1B.eps", replace



twoway (hist kurtosis, percent   width(0.25) lcolor(gs12)  fcolor(gs12)  ) ///
(hist k_15, /*xline(2, lcolor(balck) lpattern(dash))*/  percent   width(0.25) lcolor(black) fcolor(none) ), ///
graphregion(color(white)) ytitle( "%") xlabel(2(1) 9) legend(order(1 "Baseline Kurtosis" 2 "Kurtosis corrected"  )) 
graph export "$path\Graphs_Tables\Figure_A6.png", replace
graph export "$path\Graphs_Tables\Figure_A6.eps", replace


